<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateManagersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('managers', function (Blueprint $table) {
            $table->increments('id');
            $table->string('phone',11)->comment('手机号');
            $table->string('password')->comment('密码');
            $table->string('name',20)->comment('姓名');
            $table->tinyInteger('type')->comment('渠道类型:1=>公司,2=>个人');
            $table->string('company',30)->nullable()->comment('公司名称');
            $table->string('invitation_code',10)->comment('邀请码');
            $table->integer('parent_mid')->nullable()->comment('上级渠道用户id,仅在注册时填了邀请码时,会关联上级渠道用户的id');
            $table->tinyInteger('status')->comment('状态:1=>正常,0=>冻结中');
            $table->json('wx_userinfo')->comment('微信用户参数信息');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('managers');
    }
}
